﻿<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8" />
    <title>学生成绩管理系统</title>
    
	<link rel="stylesheet" href="${pageContext.request.contextPath}/tool/materialize/css/materialize.min.css"/>
    <!-- Bootstrap Styles-->
    <link href="${pageContext.request.contextPath}/tool/css/bootstrap.css" rel="stylesheet" />
    <!-- FontAwesome Styles-->
    <link href="${pageContext.request.contextPath}/tool/css/font-awesome.css" rel="stylesheet" />
    <!-- Custom Styles-->
    <link href="${pageContext.request.contextPath}/tool/css/custom-styles.css" rel="stylesheet" />
    <style type="text/css">
		.card-content p{
			text-align: center;
			color: blue;
			padding-top: 20px;	
			font-family:cursive;
			font-size:22px;
		}
		.card-content p font{
			color:  	#BF0060;
			
		}
		</style>
</head>
<body>
	<nav class="navbar navbar-default top-navbar" role="navigation">
		<div class="navbar-header">

			<a class="navbar-brand waves-effect waves-dark" href="${pageContext.request.contextPath}/homepage/teacherjsp"><i class="large material-icons">track_changes</i> <strong>成绩管理系统</strong></a>

			<div id="sideNav" href=""><i class="material-icons dp48">toc</i></div>
		</div>

		<ul class="nav navbar-top-links navbar-right">
		<li><a class="dropdown-button waves-effect waves-dark"  data-activates="dropdown3"><i class="fa fa-tasks fa-fw"></i><b>${teachers.course }老师</b> <i class="material-icons right"></i></a></li>
			<li>
				<a class="dropdown-button waves-effect waves-dark" href="#!" data-activates="dropdown1"><i class="fa fa-user fa-fw"></i> <b>${teachers.tcname }</b> <i class="material-icons right">arrow_drop_down</i></a>
			</li>
		</ul>
	</nav>
	<!--登陆的用户 -->
	<ul id="dropdown1" class="dropdown-content">
		<li>
			<a href="${pageContext.request.contextPath}/teacher/studentmanage"><i class="fa fa-user fa-fw"></i>成绩管理</a>
		</li>
		<li>
			<a href="#" data-toggle="modal" data-target="#myModal"><i class="fa fa-gear fa-fw"></i>修改密码</a>
		</li>
		<li>
			<a href="${pageContext.request.contextPath}/homepage/teacherquit" onclick="javascript:return del();"><i class="fa fa-sign-out fa-fw"></i>安全退出</a>
		</li>
	</ul>

	<nav class="navbar-default navbar-side" role="navigation">
		<div class="sidebar-collapse">
			<ul class="nav" id="main-menu">

				<li>
					<a href="${pageContext.request.contextPath}/homepage/teacherjsp" class="waves-effect waves-dark"><i class="fa fa-globe"></i>教师功能介绍</a>
				</li>

				<li>
					<a href="#" class="active-menu waves-effect waves-dark"><i class="fa fa-sort-amount-asc" aria-hidden="true"></i>授课学生信息</a>
				</li>
				<li>
					<a href="${pageContext.request.contextPath}/teacher/studentmanage" class="waves-effect waves-dark"><i class="fa fa-gavel"></i>学生成绩管理</a>
				</li>
			</ul>

		</div>

	</nav>

	<div id="page-wrapper">
		<div class="header">
			<h1 class="page-header">
                           		授课学生信息
                        </h1>
		</div>

		<div id="page-inner">

			<div class="row">
				<div class="col-md-12">
					<div class="card">
						<div class="card-content">
							<div class="table-responsive">
                                <table class="table table-striped table-bordered table-hover">
                                    <thead>
                                        <tr>
                                            <th>学生姓名</th>
                                            <th>学生学号</th>
                                            <th>性别</th>
                                            <th>年龄</th>
                                            <th>所在班级</th>
                                            <th>班主任</th>
                                            <th>联系电话</th>
                                            <th>课程成绩</th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                    <c:forEach items="${grades}" var="c">
                                        <tr>
                                            <td>${c.student.name }</td>
                                            <td>${c.student.sn }</td>
                                            <td>${c.student.age }</td>
                                            <td>${c.student.gender }</td>
                                            <td>${c.student.bj.bjname }</td>
                                            <td>${c.student.bj.bjteacher }</td>
                                            <td>${c.student.number }</td>
                                            <td>${c.grade }</td>
                                        </tr>
                                    </c:forEach>
                                    </tbody>
                                </table>
                                &emsp;&emsp;${a1 }&emsp;${a2 }&emsp;${a3 }<br>
                                <ul class="pagination pagination-sm">
								    ${sql }
								</ul>
                            </div>
						</div>
					</div>
				</div>
			</div>

		</div>
	</div>
<div class="modal fade" id="myModal" tabindex="-1" role="dialog"
		aria-labelledby="myModalLabel" aria-hidden="true"
		style="background-color: rgba(0, 0, 0, 0); width: 100%; height: 1088px;">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal"
						aria-hidden="true">&times;</button>
					<h4 class="modal-title" id="myModalLabel">修改密码	用户：${teachers.tcname }</h4>
				</div>
				<form action="${pageContext.request.contextPath}/teacher/updatepassword" method="get" id="myform" >
					<div class="modal-body">
						<input type="hidden" id="jmm1" value="${teachers.tcpassword }">

						<p>
							<label>旧密码：</label><input type="password" id="jmm">
						</p>
						<p>
							<label>新密码：</label><input type="password" id="xmm">
						</p>
						<p>
							<label>重新输入新密码：</label><input type="password" name="password" id="password">
						</p>
					</div>
					<div class="modal-footer">
						<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
						<button type="submit" class="btn btn-primary" onclick="javascript:return dell();">提交更改</button>
					</div>
				</form>
			</div>
			<!-- /.modal-content -->
		</div>
		<!-- /.modal -->
	</div>


   <!-- jQuery Js -->
    <script src="${pageContext.request.contextPath}/tool/js/jquery-1.10.2.js"></script>
	
	<!-- Bootstrap Js -->
    <script src="${pageContext.request.contextPath}/tool/js/bootstrap.min.js"></script>
	<!--//用户-->
	<script src="${pageContext.request.contextPath}/tool/materialize/js/materialize.min.js"></script>
	
    <!-- Metis Menu Js -->
    <script src="${pageContext.request.contextPath}/tool/js/jquery.metisMenu.js"></script>
    <!-- Morris Chart Js -->
	
	
	<script src="${pageContext.request.contextPath}/tool/js/easypiechart.js"></script>
	
	 <!-- DATA TABLE SCRIPTS -->
    <script src="${pageContext.request.contextPath}/tool/js/dataTables/jquery.dataTables.js"></script>
   
    <!-- Custom Js -->
    <script src="${pageContext.request.contextPath}/tool/js/custom-scripts.js"></script> 
 

</body>
<script type="text/javascript">
 	function del(){
 		var msg = "确定要退出?\n\n请选择!";
 		if (confirm(msg)==true){
 		return true; 
 		}else{ 
 		return false; 
 		}
 	};
 	function dell(){
 		var jmm1=$("#jmm1").val();
		var jmm=$("#jmm").val();
		var xmm=$("#xmm").val();
		var password=$("#password").val();
			if(jmm==""){
				alert("请输入旧密码！");
				return false;
			}else if(jmm1!=jmm){
				alert("旧密码输入错误！");
				return false;
			}else if(xmm==""){
				alert("请输入新密码!");
				return false;
			}else if(password==""){
				alert("请重复输入新密码!");
				return false;
			}else if(xmm!=password){
				alert("两次密码输入不一样!");
				return false;  
			}else{
				return true;
				}
 	};
</script>
</html>
